<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<form id="pagerForm" method="get" model="viewRequest" action="#rel#"  >
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${rootUrl}/system/logging" method="get">
	<div class="searchBar">
		<ul class="searchContent">
		    <li>
				<label>用户名称：</label>
				<input type="text" name="viewRequest.params['uname_like']" value="${viewRequest.params.uname_like}"/>
			</li>
		    <li>
				<label>日志类型：</label>
			 	<select  name="viewRequest.params['_and_logLevel_like']">
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == ''}">selected="selected"</c:if> value="">全部</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'INFO'}">selected="selected"</c:if> value="INFO">INFO</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'DEBUG'}">selected="selected"</c:if> value="DEBUG">DEBUG</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'ERROR'}">selected="selected"</c:if> value="ERROR">ERROR</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'WARN'}">selected="selected"</c:if> value="WARN">WARN</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'ALL'}">selected="selected"</c:if> value="ALL">ALL</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'FATAL'}">selected="selected"</c:if> value="FATAL">FATAL</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'OFF'}">selected="selected"</c:if> value="OFF">OFF</option>
					<option <c:if test="${viewRequest.params['_and_logLevel_eq_string'] == 'TRACE'}">selected="selected"</c:if> value="TRACE">TRACE</option>
				</select>
			</li>
			<li style="width: 460px">
				<label>日志日期：</label>
				<input name="viewRequest.params['_and_logDate_ge_string']" type="text" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" size="20" value="${viewRequest.params['_and_logDate_ge_string'] }" placeholder="开始时间"/>
				<input name="viewRequest.params['_and_logDate_le_string']" type="text" class="date" dateFmt="yyyy-MM-dd HH:mm:ss"size="20" value="${viewRequest.params['_and_logDate_le_string'] }" placeholder="结束时间"/>
			</li>
			<li>
				<label>日志位置：</label>
				<input type="text" name="viewRequest.params['_and_location_like']" value="${viewRequest.params._and_location_like}"/>
			</li>
			<li>
				<label>日志信息：</label>
				<input type="text" name="viewRequest.params['_and_message_like']" value="${viewRequest.params._and_message_like}"/>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" targetType="dialog"  width="100%" layoutH="138">
		<thead>
			<tr>
			    <th width="22" align="center">序号</th>
				<th width="60">用户名称</th>
				<th width="100">日志日期</th>
				<th width="60">日志类型</th>
				<th width="60">日志位置</th>
				<th width="100">日志信息</th>
				<th width="60">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="logging" varStatus="status">
			<tr target="data_id" rel="${logging.id}">
			    <td>${status.count}</td>
			    <td>${logging.uname}</td>
			 	<td><fmt:formatDate value="${logging.logDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td> 
				<td>${logging.logLevel}</td>
				<td>${logging.location}</td>
				<td>${logging.message}</td>
				<td>
				    <a title="查看" target="dialog" width="1000" height="600" rel="logging_show" title="查看"  href="${rootUrl}/system/logging/${logging.id}" class="btnView">查看</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>
